<?php
//Set values for page
$page_title = "Product | Piseth Phone Shop";
$current_page = "product";
require_once 'global.inc.php'; 

//get the user object from the session 
if (!empty($_SESSION['user'])) {
	$user = unserialize($_SESSION['user']);
}

$products = $GLOBALS['FE_DB']->select("items");


?>
<!DOCTYPE html>
<html lang="en">
	<?php include 'includes/header.php';?>
<body>
	<?php include 'includes/menu.php';?>
	<?php //include 'includes/slideshow.php';?>
	<div id="product" class="container" style="margin-top:60px;">
		<?php include 'includes/widget-login.php';?>
		<div class="row">
			<div class="span12">
				<h1>Products</h1>
				<p>Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.</p>
			</div>
		</div>
		<?php foreach ($products as $product) : ?>
			<div class="row item">
				<div class="span12">
						<div class="image"><a href="detail.php?product=<?php echo $product['item_id']?>"><img src="upload/<?php echo $product['picture']?>" alt="<?php echo $product['item_name'] ?>"></a></div>
						<div class="item_content">
							<div class="title"><a href="detail.php?product=<?php echo $product['item_id']?>"><?php echo $product['item_name'] ?></a></div>
							<div class="price">$ <?php echo $product['price']?></div>
							<div class><a href="cart.php?action=add&product=<?php echo $product['item_id'] ?>">ADD TO CART</a></div>
						</div>
				</div>
			</div>
		<?php endforeach; ?>
	</div>
	<?php include 'includes/footer.php';?>
	<!-- javascript -->
	<script src="js/jquery.js"></script>
	<script src="js/bootstrap.js"></script>
	</body>
</html>